prefix=/usr

all:

install:
	install -d -m 0755 "$(DESTDIR)/$(prefix)/bin"
	install -m 0755 bin/* "$(DESTDIR)/$(prefix)/bin"

	install -d -m 0755 "$(DESTDIR)/$(prefix)/libexec"
	install -m 0755 libexec/rcagent-generate-conf "$(DESTDIR)/$(prefix)/libexec"

	install -d -m 0755 "$(DESTDIR)/$(prefix)/share"
	install -m 0644 share/rcagent.conf.in "$(DESTDIR)/$(prefix)/share"

	install -d -m 0755 "$(DESTDIR)/lib/systemd/system"
	install -m 0644 systemd/rcagent.service "$(DESTDIR)/lib/systemd/system"
	install -d -m 0755 "$(DESTDIR)/lib/systemd/system/multi-user.target.wants"
	ln -sf "../rcagent.service" "$(DESTDIR)/lib/systemd/system/multi-user.target.wants"

.PHONY: all install
